package com.summer.rocketmq;

import org.apache.rocketmq.client.exception.MQBrokerException;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.remoting.exception.RemotingException;

public class Producer {
    public static void main(String[] args) throws MQClientException, RemotingException, InterruptedException, MQBrokerException {
        DefaultMQProducer producer = new DefaultMQProducer("xoxogp");
        producer.setNamesrvAddr("121.43.102.134:9876");
        producer.start();
        Message message = new Message("myTopic001", "xxxx000 第一条".getBytes());
        producer.send(message);


    }
}
